﻿/*
 * ©2009-2010 XELF
 * http://xelf.info
 */

namespace XELF.Framework {

	public partial struct Vector2 {
		/// <summary>
		/// 乗算
		/// </summary>
		/// <param name="a"></param>
		/// <param name="scale"></param>
		/// <param name="result"></param>
		public static void Multiply(ref Vector2 a, float scale, out Vector2 result) {
			result = new Vector2(a.X * scale, a.Y * scale);
		}

		/// <summary>
		/// 要素別の乗算
		/// </summary>
		/// <param name="a"></param>
		/// <param name="b"></param>
		/// <param name="result"></param>
		public static void Multiply(ref Vector2 a, ref Vector2 b, out Vector2 result) {
			result = new Vector2(a.X * b.X, a.Y * b.Y);
		}
	}

	public partial struct Vector3 {
		/// <summary>
		/// 乗算
		/// </summary>
		/// <param name="a"></param>
		/// <param name="scale"></param>
		/// <param name="result"></param>
		public static void Multiply(ref Vector3 a, float scale, out Vector3 result) {
			result = new Vector3(a.X * scale, a.Y * scale, a.Z * scale);
		}

		/// <summary>
		/// 要素別の乗算
		/// </summary>
		/// <param name="a"></param>
		/// <param name="b"></param>
		/// <param name="result"></param>
		public static void Multiply(ref Vector3 a, ref Vector3 b, out Vector3 result) {
			result = new Vector3(a.X * b.X, a.Y * b.Y, a.Z * b.Z);
		}
	}

	public partial struct Vector4 {
		/// <summary>
		/// 乗算
		/// </summary>
		/// <param name="a"></param>
		/// <param name="scale"></param>
		/// <param name="result"></param>
		public static void Multiply(ref Vector4 a, float scale, out Vector4 result) {
			result = new Vector4(a.X * scale, a.Y * scale, a.Z * scale, a.W * scale);
		}

		/// <summary>
		/// 要素別の乗算
		/// </summary>
		/// <param name="a"></param>
		/// <param name="b"></param>
		/// <param name="result"></param>
		public static void Multiply(ref Vector4 a, ref Vector4 b, out Vector4 result) {
			result = new Vector4(a.X * b.X, a.Y * b.Y, a.Z * b.Z, a.W * b.W);
		}
	}

}
